<!-- 小程序产品 -->
<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="类型">
              <j-dict-select-tag v-model="queryParam.type" title="类型" dictCode="filmsType" />
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>

            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>

    <!-- table区域-begin -->
    <div>
      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
        :pagination="ipagination" :loading="loading" class="j-table-force-nowrap"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <carProduct-Model ref="modalForm" @ok="modalFormOk"></carProduct-Model>
  </a-card>
</template>

<script>
import '@/assets/less/TableExpand.less'
import CarProductModel from './modules/CarProductModel'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { filterDictTextByCache } from '@/components/dict/JDictSelectUtil'

export default {
  name: "CarProductList",
  mixins: [JeecgListMixin],
  components: {
    CarProductModel
  },
  data() {
    return {
      description: '小程序管理页面',
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: "center",
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          }
        },
        {
          title: '类型',
          align: "center",
          dataIndex: 'type',
          customRender: (text) => {
            return filterDictTextByCache('filmsType', text)
          },
        },
        {
          title: '点赞次数',
          align: "center",
          dataIndex: 'likes',
        },
        {
          title: '浏览次数',
          align: "center",
          dataIndex: 'view',
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: "center",
          scopedSlots: { customRender: 'action' },
        }
      ],
      url: {
        list: "/mpMini/carProduct/list",
      },
    }
  },
  computed: {

  },
  methods: {

  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>